#include "inc/plot/plotter.hpp"
#ifdef QWT_QTOPIA
#include <qpe/qpeapplication.h>
#endif
    #include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_data.h>
#include <cmath>

int start()
{
  QApplication a(0, NULL);

  QwtPlot plot(QwtText("CppQwtExample1"));
  plot.setGeometry(0,0,640,400);
  plot.setAxisScale(QwtPlot::xBottom, 0.0,2.0 * M_PI);
  plot.setAxisScale(QwtPlot::yLeft,-1.0,1.0);

  QwtPlotCurve sine("Sine");
  std::vector<double> xs;
  std::vector<double> ys;
  for (double x = 0; x < 2.0 * M_PI; x+=(M_PI / 10.0))
  {
    xs.push_back(x);
    ys.push_back(std::sin(x));
  }
  sine.setData(&xs[0],&ys[0],xs.size());
  sine.attach(&plot);

  plot.show();
  return a.exec();
}